﻿@{
    ViewBag.Title = Local("PermissionView.PageTitle");
}

@model IDictionary<int, UCenterPermission>
           
@using (Html.BeginForm())
{ 
<div id="tabs">
    <ul>
    @foreach (var role in Mozlite.Common.Roles.LoadRoles().Values)
    {
        <li><a href="#tabs-@role.RoleID">@role.RoleName</a></li>
    }
    </ul>
    @foreach (var role in Mozlite.Common.Roles.LoadRoles().Values)
    {
    <div id="tabs-@role.RoleID">
        <div class="box">
            <label>@Local("UCenterPermission.AllowableExtensions")</label>
            <div class="right winput">
                <input type="text" name="AllowableExtensions-@role.RoleID" value="@Model[role.RoleID].AllowableExtensions" />
                <div class="summary">@Local("UCenterPermission.AllowableExtensions.Summary")</div>
            </div>
        </div>

        <div class="box">
            <label>@Local("UCenterPermission.MaxSingleFileLength")</label>
            <div class="right">
                <input type="text" name="MaxSingleFileLength-@role.RoleID" value="@Model[role.RoleID].MaxSingleFileLength" />
            </div>
        </div>

        <div class="box">
            <label>@Local("UCenterPermission.MaxDiskSize")</label>
            <div class="right">
                <input type="text" name="MaxDiskSize-@role.RoleID" value="@Model[role.RoleID].MaxDiskSize" />
            </div>
        </div>

        <div class="box">
            <label>@Local("UCenterPermission.AllowUpload")</label>
            <div class="right">
                @CPHelper.ShowPermissionBooleanNullable("AllowUpload", role.RoleID, Model[role.RoleID].AllowUpload)
            </div>
        </div>

        <div class="box">
            <label>@Local("UCenterPermission.AllowUploadImage")</label>
            <div class="right">
                @CPHelper.ShowPermissionBooleanNullable("AllowUploadImage", role.RoleID, Model[role.RoleID].AllowUploadImage)
            </div>
        </div>

        <div class="box">
            <label>@Local("UCenterPermission.AllowUploadFlash")</label>
            <div class="right">
                @CPHelper.ShowPermissionBooleanNullable("AllowUploadFlash", role.RoleID, Model[role.RoleID].AllowUploadFlash)
            </div>
        </div>

        <div class="box">
            <label>@Local("UCenterPermission.AllowUploadMedia")</label>
            <div class="right">
                @CPHelper.ShowPermissionBooleanNullable("AllowUploadMedia", role.RoleID, Model[role.RoleID].AllowUploadMedia)
            </div>
        </div>

        <div class="box">
            <label>@Local("UCenterPermission.AllowFileBrowser")</label>
            <div class="right">
                @CPHelper.ShowPermissionBooleanNullable("AllowFileBrowser", role.RoleID, Model[role.RoleID].AllowFileBrowser)
            </div>
        </div>

        <div class="box">
            <label>@Local("UCenterPermission.AllowComments")</label>
            <div class="right">
                @CPHelper.ShowPermissionBooleanNullable("AllowComments", role.RoleID, Model[role.RoleID].AllowComments)
            </div>
        </div>

        <div class="box">
            <label>@Local("UCenterPermission.CommentLength")</label>
            <div class="right">
                <input type="text" name="CommentLength-@role.RoleID" value="@Model[role.RoleID].CommentLength" />
            </div>
        </div>
    </div>
    }
</div>
    
<div class="box">
    <button>@Local("Permission.Save")</button>
</div>
}
